﻿namespace ACCOUNTING
{
    using C1.Win.C1FlexGrid;
    using System;

    public class FlexTHSDHD : C1.Win.C1FlexGrid.C1FlexGrid
    {
        public override CellRange GetMergedRange(int row, int col, bool clip)
        {
            CellRange cellRange = this.GetCellRange(row, col);
            if (((row >= 0) & (row <= 3)) & (col == 0))
            {
                cellRange.r1 = 0;
                cellRange.r2 = 3;
                cellRange.c1 = 0;
                cellRange.c2 = 0;
            }
            if (((row >= 0) & (row <= 3)) & (col == 1))
            {
                cellRange.r1 = 0;
                cellRange.r2 = 3;
                cellRange.c1 = 1;
                cellRange.c2 = 1;
            }
            if (((row >= 0) & (row <= 3)) & (col == 2))
            {
                cellRange.r1 = 0;
                cellRange.r2 = 3;
                cellRange.c1 = 2;
                cellRange.c2 = 2;
            }
            if (((row >= 0) & (row <= 3)) & (col == 3))
            {
                cellRange.r1 = 0;
                cellRange.r2 = 3;
                cellRange.c1 = 3;
                cellRange.c2 = 3;
            }
            if (((row >= 1) & (row <= 3)) & (col == 4))
            {
                cellRange.r1 = 1;
                cellRange.r2 = 3;
                cellRange.c1 = 4;
                cellRange.c2 = 4;
            }
            if (((row == 0) & (col >= 4)) & (col <= 8))
            {
                cellRange.r1 = 0;
                cellRange.r2 = 0;
                cellRange.c1 = 4;
                cellRange.c2 = 8;
            }
            if (((row == 0) & (col >= 9)) & (col <= 0x12))
            {
                cellRange.r1 = 0;
                cellRange.r2 = 0;
                cellRange.c1 = 9;
                cellRange.c2 = 0x12;
            }
            if (((row == 1) & (col >= 12)) & (col <= 0x12))
            {
                cellRange.r1 = 1;
                cellRange.r2 = 1;
                cellRange.c1 = 12;
                cellRange.c2 = 0x12;
            }
            if (((row == 2) & (col >= 13)) & (col <= 14))
            {
                cellRange.r1 = 2;
                cellRange.r2 = 2;
                cellRange.c1 = 13;
                cellRange.c2 = 14;
            }
            if (((row == 2) & (col >= 15)) & (col <= 0x10))
            {
                cellRange.r1 = 2;
                cellRange.r2 = 2;
                cellRange.c1 = 15;
                cellRange.c2 = 0x10;
            }
            if (((row == 2) & (col >= 0x11)) & (col <= 0x12))
            {
                cellRange.r1 = 2;
                cellRange.r2 = 2;
                cellRange.c1 = 0x11;
                cellRange.c2 = 0x12;
            }
            if (((row >= 2) & (row <= 3)) & (col == 12))
            {
                cellRange.r1 = 2;
                cellRange.r2 = 3;
                cellRange.c1 = 12;
                cellRange.c2 = 12;
            }
            if ((((row >= 0) & (row <= 2)) & (col >= 0x13)) & (col <= 0x15))
            {
                cellRange.r1 = 0;
                cellRange.r2 = 2;
                cellRange.c1 = 0x13;
                cellRange.c2 = 0x15;
            }
            if ((((row >= 1) & (row <= 2)) & (col >= 5)) & (col <= 6))
            {
                cellRange.r1 = 1;
                cellRange.r2 = 2;
                cellRange.c1 = 5;
                cellRange.c2 = 6;
            }
            if ((((row >= 1) & (row <= 2)) & (col >= 7)) & (col <= 8))
            {
                cellRange.r1 = 1;
                cellRange.r2 = 2;
                cellRange.c1 = 7;
                cellRange.c2 = 8;
            }
            if ((((row >= 1) & (row <= 2)) & (col >= 9)) & (col <= 11))
            {
                cellRange.r1 = 1;
                cellRange.r2 = 2;
                cellRange.c1 = 9;
                cellRange.c2 = 11;
            }
            return cellRange;
        }
    }
}

